function MasterView(){
	var file = Ti.Filesystem.getFile('xml/menu.xml');
	var contents = file.read();
	var xmltext = Ti.XML.parseString(contents.text);
	
	if ( file.exists() ) {
		var MasterMenuItems = [];
		var masterView = Titanium.UI.createTableView({
			top: 0,
			height: Ti.UI.FILL,
			backgroundColor: "transparent",
	    	data: MasterMenuItems
		});
		
		var menu = xmltext.documentElement.getElementsByTagName('entry');
	
		for (var i=0; i<menu.length; i++) {
			
			var title = menu.item(i).getElementsByTagName('title').item(0).textContent;
			var shortTitle = menu.item(i).getElementsByTagName('shortTitle').item(0).textContent;
			var shortDescription = menu.item(i).getElementsByTagName('shortDescription').item(0).textContent;
			var leftImage = menu.item(i).getElementsByTagName('leftImage').item(0).textContent;
			var hasChild = menu.item(i).getElementsByTagName('hasChild').item(0).textContent;
						
			var row = Ti.UI.createTableViewRow({
				height: Ti.UI.SIZE,
				width: Ti.UI.SIZE,
				hasChild: hasChild,
				shortTitle: shortTitle,
				className: "tableRow",
			});
			
			var leftImage = Ti.UI.createImageView({
				image: leftImage,
				width: "50dp",
				left: 0
			});
		
			var headerLabel = Ti.UI.createLabel({
				text: title,
				font: {
					fontSize: "16dp",
					fontFamily: (Ti.Platform.osname === "android") ? "Aller_Bd" : "Aller",
					fontWeight: "bold" //Android will ignore this
				},
				top: "3dp",
				left: "54dp",
				height: Ti.UI.SIZE,
				color: "#000"
			});
			
			var shortDescLabel = Ti.UI.createLabel({
				text: shortDescription,
				font:{
					fontSize: "10dp",
					fontFamily: (Ti.Platform.osname === "android") ? "Aller_Lt" : "Aller Light"
				},
				color: "#000",
				top: "24dp",
				height:"auto",
				left: "54dp"
			});
	
			row.add(leftImage);
			row.add(headerLabel);
			row.add(shortDescLabel);
			
			MasterMenuItems.push(row);		
		}
		masterView.setData(MasterMenuItems);

	}
	return masterView;
}

module.exports = MasterView;